package com.cyou.qb.face.service.mock;

import org.springframework.stereotype.Component;

import com.cyou.qb.face.entity.AddressInfo;
import com.cyou.qb.face.entity.Face173AccessLog;
import com.cyou.qb.face.entity.UserContact;
import com.cyou.qb.face.entity.UserInfo;
import com.cyou.qb.face.exception.QbGetDataException;
import com.cyou.qb.face.service.PassportCheckService;
import com.cyou.qb.face.service.impl.BaseFaceServiceimpl;
/**
 * 用户信息获取接口的mock实现
 * @author wangwenlong
 *
 */
@Component("QbPassportMock")
public class PassportCheckServiceMock extends BaseFaceServiceimpl implements PassportCheckService{

	@Override
	public String getUserNickname(int uid) {
		Face173AccessLog accessLog = getAccessLog();
		accessLog.setCallService(this.getClass().getName());
		accessLog.setCallServiceParam("http://i1.17173.itc.cn/2011/newgame/newgamepic");
		String nickName = "游客";
		if(uid == 1000){
			nickName = "东超";
		}else if(uid == 2000){
			nickName = "东蔚";
		}else if(uid == 3000){
			nickName = "夏婷";
		}else if(uid == 4000){
			nickName = "王文龙";
		}
		return nickName;
	}
	@Override
	public boolean isFocus(String gamecode,int uid) {
		Face173AccessLog accessLog = getAccessLog();
		accessLog.setCallService(this.getClass().getName());
		accessLog.setCallServiceParam("http://i1.17173.itc.cn/2011/newgame/newgamepic");
		return true;
	}

	@Override
	public boolean addGameFocus(String gamecode,int uid) {
		Face173AccessLog accessLog = getAccessLog();
		accessLog.setCallService(this.getClass().getName());
		accessLog.setCallServiceParam("http://i1.17173.itc.cn/2011/newgame/newgamepic");
		return true;
	}

	@Override
	public int getUserInfoCompletion(int uid) {
		Face173AccessLog accessLog = getAccessLog();
		accessLog.setCallService(this.getClass().getName());
		accessLog.setCallServiceParam("http://i1.17173.itc.cn/2011/newgame/newgamepic");
		int userInfoCompletion = 0 ;
		if(uid == 1000){
			userInfoCompletion = 0;
		}else if(uid == 2000){
			userInfoCompletion = 10;
		}else if(uid == 3000){
			userInfoCompletion = 50;
		}else if(uid == 4000){
			userInfoCompletion = 100;
		}
		return userInfoCompletion;
	}

	@Override
	public int getContactCompletion(int uid) {
		Face173AccessLog accessLog = getAccessLog();
		accessLog.setCallService(this.getClass().getName());
		accessLog.setCallServiceParam("http://i1.17173.itc.cn/2011/newgame/newgamepic");
		int contactCompletion = 0;
		if(uid == 1000){
			contactCompletion = 0;
		}else if(uid == 2000){
			contactCompletion = 10;
		}else if(uid == 3000){
			contactCompletion = 50;
		}else if(uid == 4000){
			contactCompletion = 100;
		}
		return contactCompletion;
	}

	@Override
	public UserInfo getUserInfo(int uid) {
		UserInfo userInfo = new UserInfo();
		if(uid == 1000){
			userInfo.setAge(0);
			userInfo.setBirthday("");
			userInfo.setConstellation(0);
			userInfo.setNickname("");
			userInfo.setPlayStage(0);
			userInfo.setSex(1);
			userInfo.setUserPassport("zoudongchao@cyou-inc.com");
			
		}else if(uid == 2000){
			userInfo.setAge(20);
			userInfo.setBirthday("");
			userInfo.setConstellation(10);
			userInfo.setNickname("");
			userInfo.setPlayStage(5);
			userInfo.setSex(1);
			userInfo.setUserPassport("lidongwei@cyou-inc.com");
		
		}else if(uid == 3000){
			userInfo.setAge(20);
			userInfo.setBirthday("1989-10-20");
			userInfo.setConstellation(10);
			userInfo.setNickname("乱世群魔");
			userInfo.setPlayStage(5);
			userInfo.setSex(1);
			userInfo.setUserPassport("xiating@cyou-inc.com");
			
		}else if(uid == 4000){
			userInfo.setAge(20);
			userInfo.setBirthday("1989-10-20");
			userInfo.setConstellation(10);
			userInfo.setNickname("乱世群魔");
			userInfo.setPlayStage(5);
			userInfo.setSex(1);
			userInfo.setUserPassport("wangwenlong@cyou-inc.com");
			
		}
		Face173AccessLog accessLog = getAccessLog();
		accessLog.setCallService(this.getClass().getName());
		accessLog.setCallServiceParam("http://i1.17173.itc.cn/2011/newgame/newgamepic");
		
		return userInfo;
	}

	@Override
	public AddressInfo getAddressInfo(int uid,String passport) {
		Face173AccessLog accessLog = getAccessLog();
		accessLog.setCallService(this.getClass().getName());
		accessLog.setCallServiceParam("http://i1.17173.itc.cn/2011/newgame/newgamepic");
		AddressInfo address = new AddressInfo();
		if(uid == 1000){
			address.setCity(0);
			address.setDetailedAddress("");
			address.setMobilephone("");
			address.setProvince(0);
			address.setQqNum("");
			address.setUserPassport("");
			address.setUserTrueName("");
			address.setZipCode("");
		}else if(uid == 2000){
			address.setCity(1);
			address.setDetailedAddress("");
			address.setMobilephone("");
			address.setProvince(1);
			address.setQqNum("");
			address.setUserPassport("test@cyou-inc.com");
			address.setUserTrueName("");
			address.setZipCode("111111");

		}else if(uid == 3000){
			address.setCity(1);
			address.setDetailedAddress("北京市石景山区石景山路万达广场A座");
			address.setMobilephone("18392385100");
			address.setProvince(1);
			address.setQqNum("309951183");
			address.setUserPassport("test@cyou-inc.com");
			address.setUserTrueName("王文龙");
			address.setZipCode("111111");
		}else if(uid == 4000){
			address.setCity(1);
			address.setDetailedAddress("北京市石景山区石景山路万达广场A座");
			address.setMobilephone("18392385100");
			address.setProvince(1);
			address.setQqNum("309951183");
			address.setUserPassport("test@cyou-inc.com");
			address.setUserTrueName("王文龙");
			address.setZipCode("111111");
			
		}
		return address;
	}

	@Override
	public UserContact getContact(int uid,String passport) {
		Face173AccessLog accessLog = getAccessLog();
		accessLog.setCallService(this.getClass().getName());
		accessLog.setCallServiceParam("http://i1.17173.itc.cn/2011/newgame/newgamepic");
		UserContact userContact = new UserContact();
		if(uid == 1000){
			userContact.setCity(1);
			userContact.setDetailedAddress("");
			userContact.setEmail("");
			userContact.setMobilephone("");
			userContact.setMSN("");
			userContact.setProvince(0);
			userContact.setQqNum("");
			userContact.setUserPassport("");
			userContact.setUserTrueName("");
			
		}else if(uid == 2000){
			userContact.setCity(1);
			userContact.setDetailedAddress("");
			userContact.setEmail("");
			userContact.setMobilephone("");
			userContact.setMSN("");
			userContact.setProvince(1);
			userContact.setQqNum("309951183");
			userContact.setUserPassport("test@cyou-inc.com");
			userContact.setUserTrueName("王文龙");
		
		}else if(uid == 3000){
			userContact.setCity(1);
			userContact.setDetailedAddress("北京市石景山区石景山路万达广场A座");
			userContact.setEmail("test@cyou-inc.com");
			userContact.setMobilephone("18392385100");
			userContact.setMSN("test@msn.com");
			userContact.setProvince(1);
			userContact.setQqNum("309951183");
			userContact.setUserPassport("test@cyou-inc.com");
			userContact.setUserTrueName("王文龙");
			
		}else if(uid == 4000){
			userContact.setCity(1);
			userContact.setDetailedAddress("北京市石景山区石景山路万达广场A座");
			userContact.setEmail("test@cyou-inc.com");
			userContact.setMobilephone("18392385100");
			userContact.setMSN("test@msn.com");
			userContact.setProvince(1);
			userContact.setQqNum("309951183");
			userContact.setUserPassport("test@cyou-inc.com");
			userContact.setUserTrueName("王文龙");
			
		}
		
		return userContact;
	}
	
	@Override
	public int getUserLv(int uid,String passport) throws QbGetDataException {
		Face173AccessLog accessLog = getAccessLog();
		accessLog.setCallService(this.getClass().getName());
		accessLog.setCallServiceParam("http://i1.17173.itc.cn/2011/newgame/newgamepic");
		int userLv = 0;
		if(uid == 1000){
			userLv = 1;
		}else if (uid == 2000){
			userLv = 20;
		}else if(uid == 3000){
			userLv = 50;
		}else if(uid == 4000){
			userLv = 100;
		}
		return userLv;
	}
	@Override
	public boolean plusExperience(int uid, String memo, int experienceValue,
			String passport) {
		Face173AccessLog accessLog = getAccessLog();
		accessLog.setCallService(this.getClass().getName());
		accessLog.setCallServiceParam("http://i1.17173.itc.cn/2011/newgame/newgamepic");
		return true;
	}
	@Override
	public boolean updateUserInfo(UserInfo userInfo,int uid,String passport) {
		return true;
	}

	@Override
	public boolean updateContact(int uid,UserContact cantact,String passport) {
		return true;
	}

	@Override
	public boolean updateAddress(int uid,AddressInfo address,String passport) {
		return true;
	}
	
}
